<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>TimeMap Basic Load Tests</title>
<link rel="stylesheet" type="text/css" href="../jsUnit/../css/jsUnitStyle.css">
<script language="JavaScript" type="text/javascript" src="../../jsunit/app/jsUnitCore.js"></script><script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAASI0kCI-azC8RgbOZzWc3VRQHs9wgZpGwRjGwil_qtDm9gEic5BTUz8hqqsNZYYfvNUhOqSJ-Bmk30A"
      type="text/javascript"></script>
    <script type="text/javascript" src="http://simile.mit.edu/timeline/api/timeline-api.js"></script>
    <script src="../timemap.js" type="text/javascript"></script>
    <script src="../manipulation.js" type="text/javascript"></script>
    <script src="../jsonloader.js" type="text/javascript"></script>
    <script src="../metawebloader.js" type="text/javascript"></script>
      
<script language="JavaScript" type="text/javascript">

function exposeTestFunctionNames() {
    return [
        'testItemsLoaded',
        'testItemsLoadedInEventSource'
    ];
}

function testItemsLoaded() {
    var ds = tm.datasets["test"];
    assertEquals("three items in item array", ds.getItems().length, 3);
}

function testItemsLoadedInEventSource() {
    var ds = tm.datasets["test"];
    assertEquals("two items in eventSource", ds.eventSource.getCount(), 2);
}

var tm = null;

function setUpPage() {
    tm = TimeMap.init({
        mapId: "map",               // Id of map div element (required)
        timelineId: "timeline",     // Id of timeline div element (required) 
        datasets: [
            {
                title: "Test Dataset",
                id: "test",
                data: {
                    type: "basic",
                    value: [
                        {
                          "start" : "1980-01-02",
                          "end" : "1990-01-02",
                          "point" : {
                              "lat" : 23.456,
                              "lon" : 12.345
                           },
                          "title" : "Test Event 1",
                          "options" : {
                            "description": "Test Description"
                          }
                        },
                        { // missing event
                          "point" : {
                              "lat" : 23.456,
                              "lon" : 12.3453
                           },
                          "title" : "Test Event 2",
                          "options" : {
                            "description": "Test Description"
                          }
                        },
                        { // missing placemark
                          "start" : "1980-01-02",
                          "end" : "1990-01-02",
                          "title" : "Test Event 3",
                          "options" : {
                            "description": "Test Description"
                          }
                        }
                    ]
                }
            }
        ]
    });
    setUpPageStatus = "complete";
}

function setUp() {
    var eventSource = tm.timeline.getBand(0).getEventSource();
    tm.timeline.getBand(0).setCenterVisibleDate(eventSource.getEarliestDate());
    tm.showDatasets();
}

</script>
<link href="tests.css" type="text/css" rel="stylesheet"/>
</head>

<body>
<h1>TimeMap Tests</h1>

<p>This page contains tests for the jsUnit unit testing framework. It assumes that you have the jsunit directory in the same directory as timemap - change the path to jsunit if necessary.</p>

<div id="timemap">
    <div id="timelinecontainer">
      <div id="timeline"></div>
    </div>
    <div id="mapcontainer">
      <div id="map"></div>
    </div>
</div>


</body>
</html>
